public class Client {
    public static void main(String[] args) {
        //创建命令
        LightReceiver lightReceiver = new LightReceiver();
        LightOnCommand lightOnCommand = new LightOnCommand(lightReceiver);
        LightOffCommand lightOffCommand = new LightOffCommand(lightReceiver);

        //初始化遥控器
        RemoteController remoteController = new RemoteController();
        remoteController.setOnCommands(0,lightOnCommand);
        remoteController.setoffCommands(0,lightOffCommand);

        //按按钮
        remoteController.onPressButton(0);
        remoteController.offPressButton(0);
        remoteController.pressCancel();
    }
}
